var u = 'https://embed.growform.co/modalClient/` + u + `'; if(window.location.search) { u = u + window.location.search } document.write(` `); document .getElementsByTagName("head")[0] .insertAdjacentHTML( "beforeend", '' ); var scrollPosition = 0; function preventScroll(e) { e.preventDefault(); e.stopPropagation(); return false; } function closeGrowformModal() { document.getElementById("growformModal").classList.add("growformClosedModal"); document .getElementById("growformModal") .classList.remove("growformOpenModal"); document.body.style.position = ''; document.body.style.top = ''; document.body.style.width = ''; window.removeEventListener('wheel', preventScroll, { passive: false }); window.removeEventListener('touchmove', preventScroll, { passive: false }); window.scrollTo({ top: scrollPosition, left: 0, behavior: 'instant' }); } function openModal() { scrollPosition = window.pageYOffset || document.documentElement.scrollTop; document.body.style.position = 'fixed'; document.body.style.top = '-' + scrollPosition + 'px'; document.body.style.width = '100%'; document.getElementById("growformModal").classList.add("growformOpenModal"); document.getElementById("growformModal").classList.remove("growformClosedModal"); document.getElementById("growformModal").removeAttribute("style"); window.addEventListener('wheel', preventScroll, { passive: false }); window.addEventListener('touchmove', preventScroll, { passive: false }); } if((typeof targetId !== 'undefined' && document.getElementById(targetId))) { document.getElementById(targetId).onclick = function() { openModal(); }; } if((typeof growformTargetId !== 'undefined' && document.getElementById(growformTargetId))) { document.getElementById(growformTargetId).onclick = function() { openModal(); }; } if(typeof growformTargetClass !== 'undefined') { var growformTargetClassElements = document.getElementsByClassName(growformTargetClass); for (var i = 0; i < growformTargetClassElements.length; i++) { growformTargetClassElements[i].onclick = function() { openModal(); } } }